package com.training.contoller;

import cn.dev33.satoken.util.SaResult;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.training.config.ConsumerBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: environment-supervision
 * @BelongsPackage: com.training.contoller
 * @Author: Tianyu Han
 * @CreateTime: 2024-06-24  11:12
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
public class GlobalController {
    @GetMapping("/byGlobalResource")
    @SentinelResource(value = "byGlobalResource",blockHandlerClass=
            ConsumerBlockHandler.class,blockHandler = "handlerException1")
    public SaResult byGlobalResource(){
        return SaResult.ok("按资源名称限流测试");}

}
